﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace iTeachSoft.Presentation.Code.Managers
{
    public class NameValuePair
    {
        public string Name { get; set; }
        public int Value { get; set; }

        public NameValuePair()
        {
            Name = string.Empty;
            Value = -1;
        }

        public NameValuePair(string name, int value)
        {
            Name = name;
            Value = value;
        }
    }

    public class ComboManager
    {
        public static void LoadCombo(ComboBox comboBox, NameValuePair[] items)
        {
            comboBox.Items.Clear();

            foreach (NameValuePair item in items)
            {
                ComboBoxItem comboItem = new ComboBoxItem() { Content = item.Name, Tag = item.Value };
                comboBox.Items.Add(comboItem);
            }

            comboBox.SelectedIndex = 0;
        }
    }
}
